Add 2D coords and factor out format writers