Add logging to dir
Fix nasty bug, going out of range
Get logger in init
Improve logging, allow running without gui