That's 1962 lines of code. And no clue about what you want.
If you want some help please state exactly what you want. Is the program doing something you don't want it to? What line of code is going wrong? Can you isolate the faulty code so that we don't have to try to look through nearly 2000 lines of code?