reading and writing with branches is working