changed to write fn, failing test