tried to fix some rendering code. Need some help