modify on algorithm