updating constructor of ymodel