simple implemenation of statistics