add step4 for compare, also bug fix in step4_withcount