basic framework for reading header