Closes pair problem. Mostly works