Works for the base case.