updated comments and minor variable name changes