add write_probmodel and read_probmodel functions