First attempt at a comparator implementation