Use more efficient method for permutations
Change names of some fns
Adding some details about the algorithm
Refactor residuals into its own fn
Normalize means