First round of conversion to KD Tree