Add comments, rename a few variables