added assign_binary function, started remake_matrix function