Sharks wave their heads from side to side as they swim because they are smelling the water. The nostril that gets the strongest odor points them in the direction of their prey.