changing the logic