reduce the amount of time spent checking recursion