Changes to use recursive representation