added better date management as well as event sorting