Get the logic right this time