found out why it was not working. size of sum array.