first implementation of layered redraw