Dealt with uneven lists in the codes list.

It is now a 1-dimensional list, almost like a step-by-step