Fixed the previous order function.