change the input format for event-by-event simulations and improve the fitting algorithm