Now I check the right and left boundaries. Also, I change the boundary state I am in when the position changes.