removed extra global variable definitions