Working on proper output functionality

But it doesn't quite work yet.

Signed-off-by: Gerco van Heerdt <gercovanheerdt@gmail.com>