refactored update and render loops to use clock and rendering as a system