Residual charges on atoms in organic structures: A new algorithm for their calculation