code: def _get_point(self, profile, point):
          
          cur_points_z = [p.location.z for p in profile.elements]
          try:
              cur_idx = cur_points_z.index(point.z)
              return profile.elements[cur_idx]
          except ValueError:
              new_idx = bisect_left(cur_points_z, point.z)
              new_point = Point()
              new_point.location = sPoint(point)
              new_point.time = profile.time
              profile.elements.insert(new_idx, new_point)
              return new_point
docs: Finds the given point in the profile, or adds it in sorted z order.