Made a small enchancement to the code