Ctpop and Bswap working implementation