add a fn which limits a movement of points