simple in-memory counter