solved 4
made 4 tail-recursive
solved 5