Worked with threads in the main class.