sort function on votes