implements basic stats. Improves #36