added a bit to the main loop, with comments about future development