fixed logic for recognizing different pixel #23