finishing the get most popular element in the histagram