made some variables global so that they could be used by more functions