+ Improvements due to Ben Lippmeier's suggestions :-)