Added figure saving functionality and figures