week 4 - testing, apply, and tail recursion