function definitions using lambda implemented