implemented recursive method #chop2 with ternary operators driving the recursive calls