added clear layers functionality

works but is still glitchy