creation and writing text file logic added