Assigning charges to atoms in a molecule