Reworked naming convention for temporary variables and provided further explanation and description of algorithms.