added enum and tests for findNearestNodeTo()