Changed the update and render methods