Replaced lambda with built in function