Rewrite the whole code
raise Error when buf closed.
strip return value
Merge pull request #3 from lepture/rewrite

Rewrite