Old analysis code