added save functionality to finalize and print