changed shift planning algorithm