figured out recursive part