Tweaking the logic