Updated sort class to include generics.