changed modelName to parameter instead of a global variable