Revised rendering code