updated to support newer file format starting 0x2007