sort the statements