Recommitting the AND/OR logic. Better written, and tested.