main and thread classes updated