added ability to change repeat count