Version I am reasonably happy with