Initial implementation of CBS, not test compiled