added code to order by latest version first