improved syntax, added lambdas