def position_within_overlap(pos, strand, boundary):
    """ Check if given position is within the overlap range """
    if strand == "fwd" and pos is not None and pos >= boundary:
        return True
    if strand == "rev" and pos is not None and pos <= boundary:
        return True
    return False