(jcbc) Left out permutations function; decided to include in same file for ease of use