add Main Loop sample code for the Main Loop video