added shuffle and permute methods for function