Updated to use max count.