Added base case to bubbleUp