More documentation and a function to check all the conditions of a permutation