fixed denning's goofed code