added repeat loop