PHOENIX (AP) -- An Arizona court says a Flagstaff man's confession could be used against him in a sex-crimes case even though a judge had ruled against it and prosecutors didn't appeal that ruling. The Court of Appeals upheld David Levy Greenberg's numerous convictions and prison sentences totaling 340 years in a case that began with a peeping Tom investigation. The original judge in Greenberg's case ruled that prosecutors couldn't use a confession or results of a search. Prosecutors won an appeal over use of the search evidence and filed new charges against Greenberg. A new judge got the case and ruled that the confession could be used. Greenberg appealed, but the Court of Appeals ruled Thursday the confession could be used because there hadn't been a final ruling before on its use.