merge Qi's code
Merge pull request #75 from ryuxin/master

merge Qi's code and remove warnings