Boxes now switching correctly