fixed obvious issues although still not there yet, need to check for corruption on header extraction