move self variable initialization to top of function
Merge pull request #46 from fsbdev/patch-1

move self variable initialization to top of function