perform left and right shifts