Finished rewritting BCTW