switched to lambdas