added lock for multithreading calc
finished lock logic. testing