-Switched those static variables to global variables
-Fixed a warning about signed-ness