Additional changes suggested by @wilmoore