fixing the rule length frequency diagram construction