removing comments to maintain code style, adding output frequency feature