working for B-tree subroutine API