On Heegaard diagrams of 3-manifolds