fixed concat bug, fixed regexes, added random_name for temporary file, started stats()