Modified to use global variable file