implemented suggestions in 919

I have implemented the code but have not yet tested