added sorting function(s)