replaced lambdas with regular methods
delambdanized code now works