Some small changes and added some comments