copied over extracting_processes stuff