use IOError; safer recursion; don't worry about group cycles