Further sketching of main loop, etc.