Sorts some codes