my @sorted = sort { (exists $a->{vtype_ug}) ? -1 : 0} sort { $a->{total_rate} <=> $b->{total_rate} }