Changed drawing-order logic