correct digit maximum tracking, some stylistic changes