Modified per David Blakie suggestion.