finally fixed the nearest method:
now correct and fast, but can still be improved.
Main improvement was to search the subtree containing the point first