Cleaning up the code, arrays, helper functions, etc.
...