add functions for issue #2
Merge pull request #11 from tatyusa/issue#2

add functions for issue #2