make x and y optional when writing