Added write option to initModel