Emergency commit

Probably not everything is kosher
Ironed out logging