cleaned up base case