added model writer