fixed and improved BTree