Updated script based on new logic from Rick (SLIDPRE-12).
Merge branch 'SLIDPRE-12'