working, at least !
big changes :
 - normalize input to 0,1, then scale it to 0, 2^max_tree_level
 - changed the distance computation to one using eucl distance and real X,Y to perform distance computation (less loss of precision)
 - changed the function taking the min of dist to use aggregate first(). Other is buggy. This one works fast and well
 - changed the main function to not put last level point to NULL,was creating a bug