Use a popularity function instead of maintaining a list