Proper logic, thanks to Guillaume