removed a redundant helper function
refactored the solution to the last excercise: gave helper functions more meaningful names, and inlined another helper function to the case that uses it, to aid the termination checker.