before multithreading implementation