The bacterial cell wall lies outside the cell membrane and provides several key functions for the cell. In gram-positive bacteria, the cell wall is thick and largely composed of peptidoglycan, while in gram-negative bacteria it is thinner with an additional outer membrane. Peptidoglycan is a polymer that forms the mesh-like structure of the cell wall through cross-linking of sugars and amino acids. The cell wall protects the cell, maintains its shape and integrity, and allows attachment of surface structures.