updated the value of rightX in different scopes