Wrote step 2 functions for process_all_nucs.py