     }
 }
 
-func read_csv(filename:String, _ skip_header:Bool=true, _ completeDataRow: Int=1) -> csvFile{
+// for matrix csv
+func read_csv(filename:String, _ skip_header:Bool=true, _ rowWithoutMissingValues: Int=1) -> CSVFile{
     var x: String?
     do {
         x = try String(contentsOfFile: filename, encoding: NSUTF8StringEncoding)

    {
        startrow = 1
    }
    let test = y[completeDataRow + startrow - 1].componentsSeparatedByString(",") //Use first row to detect which columns are categorical
    categorical_col = Array(count:test.count, repeatedValue:-1)
    columns=0
    for testtext in test{

    write_csv(csv.data, filename:filename, header:csv.header)
}

func write_csv(x:matrix, filename:String, header:[String] = [""]){
    var seperator=","
    var str = ""
    var i:Int=1
