Ion binding in charged polymers