added lambda to main.cpp