working for variable number of arguemnts as well