converting to use lambdas for shorter (cleaner) code
converting to use lambdas for shorter (cleaner) code