Removed dead code & corrected variable name