added changes from add_model_support branch which was removed in scienceexchange's repo