updated Model.java