Added some comments + requested reformatting