- final version with outputs