Tweaks courtesy of Marco