Updated to use threading and remove unused structs.  now builds without warnings.