Update: added shuffle algorithm