Fixed bubbleUp function and added more test cases
fixed bubbleUP, trickleDown, and added test cases