added file writing to demosstorecorrect