Further code commenting and variable name improvement