Improvements according to Daniel's review 3.