started work on bst C version