Fixed drawing so that items appear appropriately behind other items