moved most of the update code out of render, and into update
code cleanup