Keeping it recursive. Will look at trying to use a non-recursive method to speed up calculations.