Added implementation of repeat method