issue-1 added calculation and displaying frequency