added repeat functionality