add functions tests and thread classes