Gram staining is used to classify bacteria. It is based on the composition of their cell wall. Gram staining uses crystal violet to stain cell walls, iodine as a mordant, and a counterstain which marks all bacteria.