Changed hardcoded root id 2 to parameter