add function and fix bugs
Merge pull request #15 from yezhejack/master

add function and fix bugs