trying to get the logic to work