Improvements according to Erik's comments.