Tweaked version function