Conditions function, ready for rigorous testing.