Density waves and jamming transition in cellular automaton models for traffic flow