Swap 2 objects in while(true)

And please format the code… it is really annoying to read without expected formatting.