Added code comments

Forgot to comment all of the imported code, and fixed one typo.