Changed to use n and p for repeat