Patched ArraySum with the new code from Piazza