Implemented suggestions by @keflavich