Could you help me how main function does and uses sum method to result the output by following the question?