Cleaned up @bobearth's work.