Tweaked code a bit.