further code commenting and simplifying done