Added some comments for ease of reading