Is there an easier way to do all of this?

That would be a 3d array. I will be honest and say that this is not anything that I have any experience with.