prototype 'tree' functionality