Bug Fixes and Apply for all sets

Fixed infinite loop bug, non-accepting of valid inputs, invalid ==,
invalid ||. TODO: Apply for pair checking