Implementation of BBST