add trepeat() and a test for it