Use an extension function for initializing
Fix global variables
Fix usage of global variable
Merge pull request #3 from Benestar/master

Use an extension function for initializing