added basic extraction code bits, still need to put together pieces and write to a new format