Better autoshifting logic