removed use of lambda functions