major rehaul of rendering logic