make an object's functions chainable