This happens because an outer membrane stops the penetration of the stain. The test itself is useful in classifying two distinct types of bacteria based on the structural differences of their bacterial cell walls. Gram-positive bacteria retain the crystal violet dye when washed in a decolourizing solution. Compared with gram-positive bacteria, gram-negative bacteria are more resistant against antibiotics, because of their relatively impermeable cell wall.