VP-tree ruby implementation