added parameters to chaining function