Started to integrate statistics code