reworked the BST a lot, wrote corresponding tests