Revert "Changed shifting code"

This reverts commit 7f39ea4c04e43775fab046efa6bc68de5cf165a6.