Made minor changes to anyOverlap()