Implment most corrections and suggestions by @alanmcgovern