resolved problem in Algorithm -- function changePoint