I have some ideas to improve performance, the code is spaghetti right now. Thanks for the encouragement.