add basic chain function