Edited javadocs for clarity.
Fixed shadowed variables.