Trouble with write function...