added handling for left and right