corrected the wrong ordering of the function defs in lambda, eveything seems to work!