backend of #33
frontend for #33
Merge pull request #34 from hxu/issue33

Issue33