added variable preserved_dataList: stores the original data in the original order. eliminates the need to sort again when we reset after having sorted once.