Reversed final data array and fixed bug.
Fixed reverse so it was on the right array.