NameError fixed, should work fine now