Code for analyzing local runs