documentation and minor variable name tweaks