Drawing by depth, revised existing code.