Fixed some code errors

Made some additions to the file.