introducing lambda functions 

Introduced lambda functions and used std::find_if