work in progress: implementing game loop, caution: the code is extremely messy! clean up later