Added conditions and outputs