a chain function that almost works
chain closer to working as designed
some very basic tests for chain