fix minor bugs, add 'total' column for statistics
add distance class