Update utilities.py

add "nearxy" function to replace the previous one(nearxy2).
because the previous one has mistake.