implementing function "modifyModel"