was no error, just my mistake. different sizes for m and n result in C[i] != i -> assertion changed, all rigth now.