changed the logic yet again