Added some comments on code to better readability