added commenting and removed unused clear_overlay()