add base BKTree implementation