Working next version of binary matrix  code