Removed the global declaration of the variable "shared"