Removed contentOffset from calculation as it's no longer relevant