adding logic for adjusting the initial order