Shuffle functionality

Added the Shuffle functionality and unfortunately also had to include some previous commits which where not on a branch of their own