Remove unnecessary str.  Moved module import to top.  Removed bad var pass to def.