updated offsetParent function