fix syntax errors in shifting function