Implemented most of the logic and some functions in the "helper classes", does not loop infinitely. Compiles without issues.