changed interaction, added comments, changed recursive behavior