More code updates to model.js