event algoritma