Added the ability to write out to save work