attempt at sorting the order