add codes to make some statistics