Added example and some more documentation. Only include connected rectangles.