corrected base cases