add induction with foldr