adding header parsing and load command code