fixing some bug in render function, now renders a triangle