created parser for overlapping rectangles and moved helper methods to private