put in two possible use cases
Changed bubbleUp() from recursive to while loop
changed bubbleUp to while loop