Maximum tree score bug solved