function benfords_law changed into a class