added declaration of global variables