inlined tests before making recursive calls with dissappointing results