Bug fix: referencing the right variable
Minor change: deleted commented code