further refinements to the PS scripts