Improvements suggested by Dominik