OnEnd function

Learn technical details about the OnEnd function.