check randperm function it's not working