added return variable to input, and checking how many events were created