fix bugs in compose and add tests for composition
add name to anon function