Added event priority; fixed IP sorting