Adding some analytics functions