added update and render functions