Added outputs handling.
Corrections in scheme.
Demo.