added code to write the genotype matrix to row-major csv file