Changing df logic