removed global variable that was making things hard to test