adding handling for some cases of format 2
Merge pull request #94 from Ricky1833/master

adding handling for some cases of format 2