Added a few minor things  to the code