parser needs help writing file. also needs adjustment on loop array structure