Deal with nans and cut better
Proper heuristic to cut coords