added figures and made figure generation modular in regression script