Added comments to mainLoop.py