second attempt at bst checker, much better