Tweaked code