Added code for auto-assign shifts