Implementation of sum for multiple numbers