Added some comments, fixed bug when deleting event