Separated out the stuff that's not GLUT-dependent, improved real-time rules