Temporary commit with improvements proposed by @bmerry