You have posted a buttload of code and asked a rather open ended question. You get better help if you can ask a specific question and only post the code relevant to that question.