Added a btree class
Porting more stuff