modify the algorithms