got rid of all global variables