Root crashes while filling out a 2D array in a nested FOR loop