Increment version number

To publish change for patch #23, incremented the version to 1.2.1

Also re-factored the function to be more straight-forward with some
better documentation.