using argument to choose number of messages