cleanup
allow to set number of threads from mathematica
cleanup