added Flask bits, commented out non-Flask bits, tightened up code a little
turned use of creds file back on for use by Flask, seems to work