Added sorting functions for popular page