Add logic for recursive processing.