suggested changes and minor bug fixed