add factor func
Merge branch 'master' of https://github.com/hungdohuy/comp