refactored renderer; added a drawing order