remove non-descript class-global variables n and nm1
per-clas global variables should have descriptive names,
so they are not easily overridden by local variables.
'n' is a bad choice and 'nm1' doesn't need to be global
as it is just n-1. renamed 'n' to 'tablength' and turned
'nm1' into a local 'tlm1' variable.