logic added for finding if rectangle overlaps or not