more multithreading
a few fixes
format