implemented mf_write