partial implementation on BPTree