ENHANCE: Built upon the forking process and separated out the permutation calculations into functions