reorganized code, now has authentication token generated and securely stored. sha1 also available for later use