Rewrote lambda functionality to eliminate call to eval