Moved functions around

This was to help the logical set up of all the methods

No functionality was changed
Add comments explaining the layout of MainActivityLogic