Finished up write implementation