almost complete compare operation.