flatten/unflatten almost work now
test for flatten,unflatten,curry,compose,etc