ADD: function that handles with the variable number of inputs