add offline processing

mainly same neighbor event merge and event sorting