updated component count code