add maxrow
write to file