Fix undeclared variables
Merge pull request #1 from apsavin/patch-1

Fixes undeclared variables and indent in the code