adjust statistics code