Fixed the silly sorting bug