simple tree iterator implemented