Added datapoint counter

as in issue #318

Not sure if this is the only file I have to change.