added BST and merging stuff