added output unit and tests