2d array not populated correctly when using bitshift

This could be a better implementation, although I am not at all confident with structs