finish 1014 using recursion.