Added better main file and merged kdtree changes
Tweaking makefile