works like the original example
added stats