change back to lambdas and add effect synthesis