I added some comments and documentation