Fixed issue #1 and implemented code review feedback from @benbjohnson.