lots of small changes and corrections