Use lambda expression for compare instead