Integrated code for editing events