added undo and clear and removed old visibility stuff