A new model for calculating atomic charges in molecules