minor convenience additions, renaming of several variables for consistency with description