problem with pointer partialy corrected

this version not working.
kdtree have problem with pointer