Continue to fix Peter script. (Not yet 100% fixed...)