working on read/write headers