add the frequency method.