improved shift handling, closes #37