Updated Code for leftright