Reset prior buffer array when switching to new block of data
Optimize operation to for array performance, use auxiliar result array instead of slice