Added some comments and cleaning