Added handling discrete output.