Fix one more bug duplicate entries bug in the browsing history and add more comments to the code