add some more predicates, close #323
factor out canopyindex