public void toFile(Writer out) throws IOException{
    	boolean msgFlag = false;
    	for(String s : this){
    		if(!this.type.prefix().startsWith("msg")){
    		 out.append(this.type.prefix() + " ");
    		 out.append(s +"\n");
    		}
    		else if(msgFlag){// wrap in string qoutes with /n"
    			out.append("\""+s+"\""+"\n");
    		}
    		else if(!msgFlag && (size() < 2)){ // it starts with msg	
    	    	out.append(this.type.prefix() +" \""+ s +"\""+"\n");
    	    }
    		else{
    			out.append(this.type.prefix() +" \"\""+ "\n");
    			msgFlag=true;
    		}
    	}
    }