adding REPEAT option and code