Added some comments and cut down on the code