State swap example done and working.