Lesson four complete
Moved rendering code to be inside the loop.