started on c, problelm with the recursive solution