Fixed up the rendering code, it works now, but still needs work to make it look correct.