replaced lambda with std functions