displaying a message a given number of times