equivalent using count