collect_re_impement working code