added ability to save intermediary models to a target directory