added final result sorting