implementing read header