finalized functions to get the 'nearest mouse'