sanity checks on input coordinates