Shuffle shuffle

Somewhere near spaghetti code I got lost in: