B-Tree logic implemented