<P> Green is promoted to senior detective after Fontana retires . He is partnered with Nina Cassady (Milena Govich), over the objections of Van Buren, who thinks Cassady is too inexperienced to be a homicide detective . Initially, Green seems to have a similar opinion, but as time passes, their partnership becomes more solid and they become more relaxed and friendly with one another . Their relationship remains professional, however . </P> <P> After Cassady's departure, Green is next partnered with Cyrus Lupo (Jeremy Sisto). Green's reaction to Lupo is somewhat reserved at first, especially since the first case they work together is the suicide of Lupo's brother . Green is opposed to Lupo's working the case at all, but Van Buren overrules him . However, after a short period of time, Green seems to become more comfortable with Lupo as he does with his other partners . Around mid-season, Green even takes to affectionately dubbing Lupo as "Loops". </P> <P> Mid-way through Season 18, Green is involved in a shooting that leads to his being indicted and tried, though all charges are subsequently dropped . Even though Van Buren assures him that he is welcome back on the force, Green, unhappy with having "broken every rule in the book", decides to leave the squad . Lupo is given Green's position of senior partner, and Detective Kevin Bernard (Anthony Anderson) of the Internal Affairs Bureau, who investigated Green, becomes Lupo's new partner . </P> <P> Green represents the L&O franchise's return to the wild, "Dirty Harry" type of character once popularized by Mike Logan (Chris Noth). Among the few personal touches made to the character are his affinity for gambling; he makes trips to Atlantic City often enough that Briscoe teases him about it . Subsequent episodes reveal that Green had stopped gambling but then fell back into it briefly after Briscoe's retirement . </P>

How did detective ed green leave law and order
find me the text answering this question