implement instruction count based on type