fixed header and added FIXME
implemented read/dirty flags