Added adjustBubblePosition method