Added function for copying 3d sub arrays
Changed to memcpy version