corrected OR logic and NOT implemented