Added minor echanges to code and more testing