Updated rendering code