now is calculating frequencies