added comparator for lexigrahic comparison