Allow number of events to be specified