tryig to do file io
presentable state
mixing 1 and 2
reorganised for submission