updated

algorithm is updated