First working version
Fixes. Currently prints to stout.