updated extract_loops.py to copy beginning of loop to end