massivly improved logging and fixed #1 threading