fixed errors added comments