should fix undefined variables
Merge pull request #175 from Align/graham-march-25-4

should fix undefined variables