Refactor code and make syntax more Ruby-like.
Merge pull request #2 from cjlwired/patch-1

Refactor code and make syntax more Ruby-like.