implement basic stats. Improves #36