Almost there with the logic