Altered the compareBy method to accept a list of functions.