Removed num_functions calculation and check_sum calculation for use template