Added better multi threading