The crew submerges the vessel by opening vents in the top of the ballast tanks and opening valves in the bottom. This lets water flood into the tank as air escapes through the top vents. As air escapes from the tank, the vessel's buoyancy decreases, causing it to sink. For the submarine to surface, the crew shuts the vents in the top of the ballast tanks and releases compressed air into the tanks. The high-pressure air pocket pushes the water out through the bottom valves and increases the vessel's buoyancy, causing it to rise. A submarine may have several types of ballast tank: main ballast tanks for diving and surfacing, and trimming tanks for adjusting the submarine's attitude (its 'trim') both on the surface and when underwater.