Code

Cleanup and fix the main loop to make view point to the current view