relabeled some memory copy locations
Math optimizations
Added one-dimensional arrays.