Logic. Not mine. TESTS.