What are two ways in which valence electrons of atoms participate in bond formation?