new version of analysis script