25 times faster, more idiomatic Ruby.

Accept the pull request, then git pull, then you get my changes.