write and read markers from file