1. minor refactor
Merge branch 'master' of https://github.com/hankes-garden/mycode.git
1. reduce some unnecessary memory use;
2. add a input parameter for working directory;
3. some minor refactoring