implemented suggestions in 919

I have implemented the code but have not yet tested; see #919