Reorganized so Flask would work