fixed the compare statements