Working shuffling logic

The logic is not working but should soon, need more work. Check loops