Update script to be PICES aware and clean up some comments.