fixed d//2, added things for square toric code/armchair data