Thanks - fixed and DRYed.  I omitted the return value assignment and tweaked the whitespace a bit for clarity (I hope).  Any other feedback very welcome.