- added/corrected comments
- renamed end_main_loop() to end_loop() in common.c