Added statistics
Merge with Puppet Biancini's code