Changed to free rectangles after removing them from the iter instead of before since removing them before they'd still be in the iter and referenced so maybe they weren't really freeing?