Add sorting function for ordering related information

Issue #203