New C-version of grams counter, works well (also added Perl utitities to check it up).