added some unit tests and changed the name of a function to something more universal
Added my name as the author
An example of how to use the api
I only made a few changes to the orginal code
added an author comment