handling any number of nums