You misundertood the function requirement here. The function should return the longest ORF sequence not the length of it .

    return L