Started adding more comments and cleaning code