analysis script cleanup