Fixed logic, still problem getting the sum as result