First implementation of compare trees