moved comparing coordinates to location class, allowing square's comparison operators to be rewritten simply