Removed groupRectangles(for now) since it does not seem to do anything