changing to flask & writing mfold lib