fixed buildtree and added into crowd applet

just need to optimize the nearestneighbors query