refactoring, added 'shuffle