simple tree implementation in ruby