Added frecency calculator and unit test.