I'm concerned about mismatches between ```distance(x|y)``` and ```mask```. i wonder if it could be simpler as to have a check where if both are provided, ```mask``` takes precedence with some warning.