Returning the sum of all fields for a given algorithm