Use functions and extern files.
Bugfix.
Multithreading target added.
Fix.