added ldoc for thread, removed some extraneous error checking.