updated code for Models