Simplification suggested by Ryan Davis.