Improvements suggested by Mato