added perm function for all stats
added permutation functions and fixed some typos