Updated render code