completed the render and tick codes