found solution to the randomiser problem using factorials, needs refactoring because its a bit of a mess