fix lambda variables' types and rename cps function