add some comments and removed trackstats method