Finished write functionality