Code for plots and calculating coverage