This calls itself and has a base case to prevent an infinite loop