added figure_dir and saving of explained variance figure