basic working copy of smart_repeater