more key tree implementation and test