Updated analysis script: