start of findBestShift