a simple statistics engine