generalize to functions with arbitrary amount of args