rewrote model