More thread organizing: not working code yet
Log code fixed

Finally.