Fixed buffer overflow and am part-way through fixing multi-write for 2D