Grr, added missing global statement and a little comment