Removing unnecessary global variable "mod"