Adding median splitting creation of kdTree