Modify Algorithm

Signed-off-by: masphei <masphei@gmail.com>