added global variable to ex3