cleaned up the code in preparation for release.