Using lamda function for compare instead.