fixed most of the obvious bugs
removed uneeded copies of flask program
deleted obsolete code
some minor aditions