I am trying to take a randomly generated 3d image and, using the idea that it is multiple 2d planes laid atop each other, overlap the 2d arrays until there is a one 2d array showing the overlapping values. The program I have now works well with small arrays, but the computer does not have the memory to deal with my needs. I need to have a final overlapping image of a 1024 x 768 array, and the 3d array is usually around (76-125)x1024x768. Is there a way to dump the memory in the shift register after it's been used once to free up space? or is there a simpler solution?