Extensive Changes: Function modifications, Documentation tweaks, Added a testing apparatus (though no tests).