updated model code