Added BTree loop