shift left or right based on num