Removed junk code and fixed last bug by using a Class instead of pointers to arrays, which were being very buggy