added statistics with comments (no cal, because need to have the final values)

Signed by Diego Rondelli <diego-ronde@hotmail.it>
added factory pattern

signed by diego rondelli