validateCoords function

Utility function to check if a coordinates is valid