added result sorting