Merge pull request #22 from jcrom/master

refs #19.  optimize the implement.