Made private compare method more readable