finalized the result output