m49

update algorithm part