'global' should be at the beginning of function. Also, position of { does not follow our standards.