wrote cpu_filter function