putted some notes on how to structure the code for the main control
loops