addded index of incidents and cleaned up code