extracted the write out to it's own method. Also added verbosesness to it