got rid of globals