Cleaning up the segment rendering code.
Adding a comment