did some recursion programming