Commented code, modified a few variable names