implementing horizontal translation