Using buffered writer, writing to a file