fixed a mistake with weight calculation, also weight normalisation
some tests with threaded code to see if it is worth to thread application, using multiprocessing module for now