Added more comments in code.