Replacing the vals array with an int sum