binary tree and longsubs (ruby)