added additional comments and corrections made as per the insturctions given in the course