updated with new example data and fixed a bug writing the ms_file