Updated analysis script