made questionArray a global variable