solved compare inefficiency