Updated code based on code review. Added an example test and well as the testharness.