Trying to get trending function to work