Sorry for late update. Created new classes to divide up the code. I will try to add more comments as I go along.