run analysis combined into a function