Finished writeToCell function