make chain function chainable
unit tests
Merge with Rob , Make chain chainable