Modularizing, rationalizing variable names.  Not done.

Signed-off-by: David Brainard <brainard@psych.upenn.edu>