removing frequency-related code from count_components