refer others' algorithm, good