Updated tooltip positioning logic to work in Chrome and Firefox (old version was accurate in Chrome only)