improved filtering of closed rectangles (changed radius from 20 to 30)