Added comments and thread operability