updated the getorder functions