Removed all global variables. Added GPL license