Changed format of population matrix from 2D to 3D