script for preparing analysis