added end simulation method