version using anonymous functions passing to checkThatSum