fixed wonky logic