Updated with a boolean logic.