started writing generateOutputFile method