Why is my code throwing a NameError for the variable 'a'