too much piling into this one commit, but have to start somewhere.
fixed drawing order