improved shifting with constants