Create plot_cals subroutine
Clean up code