Algorutm encoding each bit block