implemented output computation