minor changes
update algorithm, keep in pace with linux branch