added sort order feature

added to master for appliance based version