Add comments, minor reformatting